# frozen_string_literal: true

class SessionsController < ApplicationController
  def create
    cookies.signed[:username] = params[:session][:username]
    user = User.find_or_create_by!(name: cookies.signed[:username])
    cookies.signed[:user_id] = user.id
    redirect_to '/rooms/show'
  end
end
